package com.example.togethermove.ui.activity.honor;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.togethermove.R;
import com.example.togethermove.base.BaseActivity;
import com.example.togethermove.base.BaseActivityone;
import com.example.togethermove.base.Fields;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

//创建盟名称
public class AllyNameActivity extends BaseActivity {
    @BindView(R.id.iv_headLeft)
    ImageView ivHeadLeft;
    @BindView(R.id.tv_headTitle)
    TextView tvHeadTitle;
    @BindView(R.id.iv_headRight)
    ImageView ivHeadRight;
    @BindView(R.id.tv_headRight)
    TextView tvHeadRight;


    @BindView(R.id.et_ally_name)
    EditText et_ally_name;
    @BindView(R.id.tv_complete)
    TextView tv_complete;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ally_name) ;
        ButterKnife.bind(this);
        tvHeadTitle.setText("盟名称");

    }
    @OnClick({R.id.iv_headLeft,R.id.et_ally_name,R.id.tv_complete,})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_headLeft:
                finish();
                break;

            case R.id.tv_complete://完成
                et_ally_name.getText().toString().trim();

                SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(Fields.sharePreferences.filename, Context.MODE_PRIVATE);
                SharedPreferences.Editor edit = sharedPreferences.edit();
                edit.putString(Fields.sharePreferences.allyname, "allyname");



                finish();
                break;


        }
    }
}